package com.gxa.meiye.admin.controller.zy;

import com.gxa.meiye.admin.service.DoorService;
import com.gxa.meiye.core.common.JsonResult;
import com.gxa.meiye.core.pojo.domain.Therapist;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author: zy
 * @CreateTime: 2022-07-21  10:15
 */
@RestController
@Api(value="美疗师风采",tags = "美疗师风采接口")
@RequestMapping("/therapist")
public class TherapistdController {
    @Autowired
    private DoorService doorService;
    //美疗师
    @ApiOperation("美疗师")
    @GetMapping("/searchBeauty")
    public Map searchBeauty(){
        List<Therapist> select = doorService.select();
        JsonResult jsonResult=new JsonResult();
        if (!StringUtils.isEmpty(select)){
            jsonResult.setCode("1");
            jsonResult.setMsg("查询成功");
            jsonResult.setData(select);
        }
        return jsonResult.getMap();
    }
    //查询美疗师信息
    @ApiOperation("美疗师信息")
    @GetMapping("/Beauty")
    public Map Beauty(String name){
        Therapist therapist = doorService.selectBeauty(name);
        JsonResult jsonResult=new JsonResult();
        if (therapist!=null){
            jsonResult.setCode("1");
            jsonResult.setMsg("查询成功");
            jsonResult.setData(therapist);
        }
        return jsonResult.getMap();
    }
}
